/**
 *
 */
package cn.hg.jfsa.manage.web;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;

/**
 * 由于Layui数据表格使用的数据与JFinal的Page不一样，因此使用此类包装Page并通过renderJson()方式返回
 *
 * @author Golly
 */
public class LayuiPage {

	private int code = 0;
	private int count = 0;
	private Object data = new Object();
	private String msg = "";

	public LayuiPage (List<?> list) {
		this.count = list.size();
		this.data = list;
	}

	public LayuiPage (Page<?> page) {
		this.count = page.getTotalRow();
		this.data = page.getList();
	}

	public int getCode () { return this.code; }

	public int getCount () { return this.count; }

	public Object getData () { return this.data; }

	public String getMsg () { return this.msg; }

	public void setCode (int code) { this.code = code; }

	public void setCount (int count) { this.count = count; }

	public void setData (Object data) { this.data = data; }

	public void setMsg (String msg) { this.msg = msg; }

}
